<?php
session_start();
//$_SESSION['ls_userid'] = 'pewpew';
include("dbInfo.php");

$currentPageTitle = "";
$currentPageURL = "";

function printHeader () {
	global $currentPageTitle, $currentPageURL;
	$query = "SELECT * FROM htmlPages";
	$result = mysql_query($query) or die( "Cannot query htmlPages" . mysql_error() );
	$currentFile = $_SERVER['PHP_SELF'];
	$parts = explode('/', $currentFile);
	
	echo '<div id="header-menu"><ul>';
	
	while ( $row = mysql_fetch_array($result) ) {
		
		if ( $parts[count($parts) - 1] == $row['URL'] ) {
			$currentPageTitle = $row['title'];
			$currentPageURL = $row['URL'];
			echo ' <li class="current_page_item"><a href="http://www.hungmun.com/c410/site-gui/'.$row['URL'].'">'.$row['title'].'</a></li>';
		}
		
		else {
			echo ' <li class="page_item"><a href="http://www.hungmun.com/c410/site-gui/'.$row['URL'].'">'.$row['title'].'</a></li>';
		}
		
	}
	
	echo '</ul></div>';
		
	
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/c410/site-gui/style.css" type="text/css" media="screen" />
<!--[if IE]><link rel="stylesheet" type="text/css" href="style_ie.css" /><![endif]-->
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="style_ie6.css" /><![endif]-->
